from pygame.sprite import Sprite
import pygame
class Cube (Sprite):
    # how many times does a ball need to collide with cube
    strength = 1
    magic = None
    
    def __init__(self, point, type, magic):
        pygame.sprite.Sprite.__init__(self) #call Sprite initializer
        self.image = pygame.image.load('cube_' + str(type) + '.png').convert()
        self.image.set_colorkey(self.image.get_at((0,0)))
        self.rect = self.image.get_rect()
        self.rect = self.rect.move((point.x,point.y));
        if ( type == 2 ):
            self.strength = 2
        self.magic = magic
        
            
    def is_dead(self):
        return self.strength == 0
    
    def hit_by_ball(self):
        self.strength = self.strength - 1
    
    def update(self):
        pass
    
    def get_magic(self):
        return self.magic
        
    def has_magic(self):
        return self.magic != None
        
    